//声明变量
$font-s-14: 14px;
$font-s-12: 12px;
$color-f: #fff;
$color-9: #999;
$color-6: #666;
$color-3: #333;
$color-red: #ff6767;
$bor-col-dc: #dcdcdc;
$color-f2: #f2f2f2;

//带参数的混合器
@mixin rounded($x) {
  -moz-border-radius: $x;
  -webkit-border-radius: $x;
  border-radius: $x;
}

@mixin over-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@mixin translate($x, $y) {
  -webkit-transform: translate($x, $y);
  -moz-transform: translate($x, $y);
  -ms-transform: translate($x, $y);
  -o-transform: translate($x, $y);
  transform: translate($x, $y);
}

@mixin tranition($prop, $time) {
  -webkit-transition: $prop $time;
  -moz-transition: $prop $time;
  -ms-transition: $prop $time;
  -o-transition: $prop $time;
  transition: $prop $time;
}

@mixin shadow($inset, $hoff, $voff, $blur, $color) {
  -webkit-box-shadow: $inset $hoff $voff $blur $color;
  -moz-box-shadow: $inset $hoff $voff $blur $color;
  box-shadow: $inset $hoff $voff $blur $color;
}

html, body, div, p, span, a, em {
  margin: 0;
  padding: 0;
}

em, i {
  font-style: normal;
}

body {
  font-family: "Microsoft Yahei";
}

a {
  text-decoration: none;
}

input {
  outline: medium;
}

.fl {
  float: left;
}

.fr {
  float: right;
}

/*清除浮动*/
.clear:after {
  display: block;
  clear: both;
  content: "";
  visibility: hidden;
  height: 0
}

.clear {
  zoom: 1
}

.u-flyer {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50px;
  position: fixed;
  z-index: 9999;
}

.sidebar-con {
  z-index: 99;
  position: fixed;
  top: 0px;
  right: -280px;
  width: 316px;
  height: 100%;
  background-color: $color-f;
  @include tranition(right, .5s);

  &.right {
    right: 0px;
  }

  .sidebar-nav {
    position: relative;
    width: 36px;
    height: 100%;
    background-color: $color-6;
    .msg-list-t {
      position: absolute;
      left: 0;
      top: 162px;
    }
    .msg-list-b {
      position: absolute;
      left: 0;
      bottom: 50px;
    }
    .sid-nav-a {
      position: relative;
      display: block;
      color: $color-f;
      font-size: $font-s-14;
      text-align: center;
      padding: 0 10px;
      cursor: pointer;
      &.cur {
        background-color: #555;
      }
      &:hover {
        background-color: #555;
        span {
          display: block;
        }
      }
    }

    .sid-user-msg {
      display: none;
      z-index: 15;
      position: absolute;
      top: -20px;
      right: 36px;
      width: 300px;
      height: 200px;
      background-color: #fff;
      @include shadow(-1px, 0px, 7px, -1px, #999);
      &:after {
        content: '';
        position: absolute;
        top: 32px;
        right: -5px;
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-left: 6px solid #fff;
        border-bottom: 6px solid transparent;
      }

      .user-msg-top {
        height: 100px;
        border-bottom:1px solid #dcdcdc;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        .user-img {
          display: block;
          width: 60px;
          height: 60px;
          margin: 20px 10px 0 40px;
          -webkit-border-radius: 100%;
          -moz-border-radius: 100%;
          border-radius: 100%;
          overflow: hidden;

          img {
            width: 100%;
          }
        }
        .top-text {
          .user-name {
            margin-top: 23px;
            font-size: 16px;
            color: #333;
          }
          .sign-in {
            display: block;
            margin-top: 14px;
            width: 70px;
            height: 20px;
            line-height:20px;
            text-align: center;
            font-size: 12px;
            color: #999;
            border: 1px solid #999;
            -webkit-border-radius:5px;
            -moz-border-radius:5px;
            border-radius:5px;
          }
          >p{
            text-align: left;
            font-size:14px;
            color: #333;
            line-height: 20px;
            &.login-out-msg{
              margin-top: 27px;
            }
            >a.go-login{
              color: #0daeff;
            }
          }

        }
      }

      .user-msg-bot{
        padding:20px 0;
        .bot-item{
          float: left;
          width:100px;
          -webkit-box-sizing: border-box;
          -moz-box-sizing: border-box;
          box-sizing: border-box;
          p{
            height:33px;
            line-height:33px;
            color: #333;
            font-size:14px;
            text-align: center;
          }
          &.coupon{
            border-left:1px dotted #eee;
            border-right:1px dotted #eee;
          }
        }
      }
    }

    .sidebar-nav-msg {
      display: none;
      z-index: 15;
      position: absolute;
      top: 0px;
      left: -80px;
      width: 80px;
      height: 36px;
      background-color: $color-f;
      color: $color-6;
      line-height: 36px;
      text-align: center;
      @include shadow(-1px, 0px, 7px, -1px, #999);

      &:after {
        content: '';
        position: absolute;
        top: 12px;
        right: -5px;
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-left: 6px solid #fff;
        border-bottom: 6px solid transparent;
      }
    }

    .sidebar-nav-msg-code {
      display: none;
      position: absolute;
      top: 4px;
      left: -121px;
      width: 120px;
      height: 120px;
      background-color: #fff;
      text-align: center;
      color: $color-red;
      font-size: $font-s-12;
      @include shadow(-1px, 0px, 7px, -1px, #999);

      &:after {
        content: '';
        position: absolute;
        top: 8px;
        right: -5px;
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-left: 6px solid #fff;
        border-bottom: 6px solid transparent;
      }

      img {
        width: 100px;
        height: 100px;
        margin: 4px 10px;
        margin-bottom: 0;
      }
    }

    .num-msg {
      position: absolute;
      bottom: 8px;
      right: 8px;
      min-width: 18px;
      height: 18px;
      font-size: $font-s-12;
      color: $color-f;
      background-color: $color-red;
      @include rounded(7px); //引用带参数混合器
      text-align: center;
      line-height: 18px;
    }

    .sid-bot {
      padding: 0;
      width: 36px;
      height: 36px;
      margin-bottom: 8px;
      > img {
        position: absolute;
        width: 20px;
        //top: 50%;
        //left: 50%;
        //@include translate(-50%, -50%);
      }
    }
    .sid-ct {
      padding-top: 38px;
      padding-bottom: 28px;
      line-height: 1.2;
      > img {
        position: absolute;
        top: 10px;
      }
    }

    .sid-user {
      &:hover{
        .sid-user-msg{
          display: block;
        }
      }
      > img {
        left: 8px;
        top: 7px;
      }
    }

    .sid-cart {
      > img {
        left: 4px;
      }
    }
    .sid-company {
      margin-bottom: 130px;
      margin-top: 10px;
      > img {
        left: 6px;
        top: 10px;
      }
    }

    .sid-service {
      > img {
        top: 8px;
        left: 8px;
      }
    }
    .sid-code {
      > img {
        top: 8px;
        left: 8px;
      }
    }
    .sid-news {
      > img {
        top: 8px;
        left: 8px;
      }
    }
    .sid-stick {
      > img {
        top: 8px;
        left: 8px;
      }
    }

  }

  .sidebar-commodity {
    position: relative;
    width: 280px;
    height: 100%;
    overflow: hidden;
    background-color: $color-f2;

    .com-title {
      width: 100%;
      height: 39px;
      padding: 0 10px;
      line-height: 40px;
      border-bottom: 1px solid $bor-col-dc;
      font-size: $font-s-14;
      color: $color-6;
      background-color: $color-f;
      span {
        float: right;
        width: 40px;
        height: 40px;
        margin-right: 10px;
        background: url("../images/sidebar/sid-close.png") no-repeat center;
      }
    }

    .log-out {
      padding: 50px;
      font-size: $font-s-14;
      color: $color-6;
      p {
        line-height: 26px;
      }
      a {
        display: block;
        margin-top: 10px;
        width: 60px;
        height: 30px;
        font-size: $font-s-14;
        color: $color-f;
        text-align: center;
        line-height: 30px;
        background-color: $color-red;
        @include rounded(4px);
      }
    }

    .com-null {
      margin-top: 50px;
      margin-left: 15px;
      font-size: $font-s-14;
      color: $color-6;
    }

    .com-list {
      position: absolute;
      top: 40px;
      left: 0;
      bottom: 90px;
      width: 280px;

      //定义滚动条宽高及背景，宽高分别对应横竖滚动条的尺寸
      //&::-webkit-scrollbar {
      //  width: 6px;
      //}

      //定义滑块，内阴影及圆角
      //&::-webkit-scrollbar-thumb {
      //  border-radius: 10px;
      //  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
      //  background-color: #999;
      //}

      .com-list-item {
        position: relative;
        width: 100%;
        padding: 9px 0;
        background-color: $color-f;
        &:hover {
          .item-con {
            > p {
              color: $color-red;
            }
            .price-count {
              .count {
                display: none;
              }
              .count-action {
                display: block;
              }
            }
          }

        }
        p {
          width: 210px;
          @include over-ellipsis;

          span {
            margin-right: 3px;
            padding: 0 2px;
            color: #ff6767;
            border: 1px solid #ff6767;
          }

        }

        .item-img {
          float: left;
          width: 52px;
          height: 52px;
          margin: 0 5px 0 3px;
          img {
            width: 100%;
            max-height: 52px;
          }
        }
        .item-con {
          float: left;
          //width: 214px;
          height: 70px;
          font-size: $font-s-12;
          color: $color-3;
          line-height: 1.5;
          .company {
            color: $color-9;
            margin-top: 5px;
          }
          .price-count {
            margin-top: 8px;

            .count-action {
              display: none;
              border: 1px solid $bor-col-dc;
            }
            .count {
              text-align: center;
            }

            em {
              float: left;
              color: $color-red;
              line-height: 20px;
            }
            span {
              float: right;
              margin-right: 40px;
              width: 74px;
              height: 20px;
              line-height: 18px;
              i {
                float: left;
                width: 20px;
                height: 20px;
                text-align: center;
                cursor: pointer;
              }
              input {
                float: left;
                border: none;
                background: none;
                width: 30px;
                height: 18px;
                text-align: center;
                font-size: $font-s-12;
                border: 1px solid $bor-col-dc {
                  top: 0;
                  bottom: 0;
                }
              }

            }
            .delete-btn {
              float: right;
              width: 20px;
              height: 20px;
              margin-right: 5px;
              background: url("../images/sidebar/sid-del.png") no-repeat center;
            }

          }
        }

      }

      .com-list-active {
        margin-top: 10px;
        margin-bottom: 10px;
        background-color: #fff;
        .active-title {
          padding: 0 10px;
          height: 30px;
          line-height: 30px;
          font-size: $font-s-12;
          color: $color-3;
          border-bottom: 1px solid #eee;
          span {
            color: $color-f;
            padding: 0 3px;
            background-color: #ff6767;
            margin-right: 5px;
          }
          em {
            color: $color-red;
          }
        }
        .com-list-item {
          .ms-msg {
            float: left;
            padding: 0 5px;
            height: 20px;
            line-height: 20px;
            margin-top: 5px;
            a {
              font-size: $font-s-12;
              color: $color-9;
            }
            &:hover a {
              text-decoration: underline;
            }
          }
          &:before {
            content: '';
            position: absolute;
            bottom: 0px;
            left: 80px;
            width: 214px;
            height: 1px;
            background-color: #eee;
          }
          &:last-child:before {
            display: none;
          }
        }
      }
    }

    .go-cart {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 68px;
      padding: 10px 0;
      background-color: $color-f2;
      > p {
        width: 100%;
        line-height: 20px;
        text-align: center;
        > em {
          color: $color-red;
        }
      }
      > a {
        display: block;
        width: 140px;
        height: 36px;
        margin: 10px 0 0 80px;

        line-height: 36px;
        text-align: center;
        background-color: $color-red;
        color: $color-f;
      }
    }

  }

  .sidebar-coupon {
    @extend .sidebar-commodity;
    background-color: #fff;
    position: relative;
    .com-title {
      @extend .com-title;
      background-color: #f2f2f2;
      border-bottom-color: #fff;
    }
    .coupon-con {
      .coupon-list {
        position: absolute;
        top: 40px;
        left: 0;
        bottom: 56px;
        width: 280px;
        .coupon-tit {
          position: relative;
          font-size: 16px;
          color: #333;
          padding-top: 15px;
          text-align: center;
          margin-bottom: 10px;
          .txt {
            position: relative;
            z-index: 1;
            background-color: #fff;
            padding: 0 5px;
          }
          .bor {
            position: absolute;
            top: 24px;
            left: 20px;
            width: 240px;
            height: 1px;
            background-color: transparent;
            border-top: 1px dashed #ccc;
          }
        }
        .get-coupon {
          .con-null {
            text-align: center;
            img {
              padding-top: 20px;
            }
            p {
              padding: 10px 0 50px 0;
              font-size: 12px;
              color: #ff6767;
            }
          }
          .get-coupon-list {
            ul {
              li {
                position: relative;
                left: 10px;
                height: 100px;
                width: 270px;
                margin-top: 10px;
                border: 1px solid #74d2d4;
                -webkit-box-sizing: border-box;
                -moz-box-sizing: border-box;
                box-sizing: border-box;
                .coupon-text {
                  padding-top: 20px;
                  width: 228px;
                  .text-price {
                    height: 42px;
                    line-height: 42px;
                    font-size: 16px;
                    color: #74d2d4;
                    margin-left: 10px;
                    margin-right: 10px;
                    span {
                      font-size: 36px;
                    }
                  }
                  .text-msg {
                    color: #74d2d4;
                    .msg-p1 {
                      font-size: 16px;
                    }
                    .msg-p2 {
                      padding-top: 10px;
                      font-size: 14px;
                    }
                  }
                  .coupon-time {
                    float: left;
                    width: 210px;
                    font-size: 12px;
                    color: #74d2d4;
                    margin-top: 15px;
                    margin-left: 10px;
                  }
                }
                .get-coupon-btn {
                  width: 40px;
                  height: 100%;
                  background-color: #74d2d4;
                  text-align: center;
                  span {
                    position: relative;
                    top: 20px;
                    left: 13px;
                    display: block;
                    font-size: 14px;
                    color: #fff;
                    width: 16px;
                    text-align: center;

                  }
                  &:hover {
                    span {
                      color: #333;
                    }
                  }
                }
              }
            }
          }
        }
        .my-coupon {
          .con-null {
            p {
              text-align: center;
              font-size: 12px;
              color: #ff6767;
              padding: 30px 0;
            }
          }
          ul {
            li {
              position: relative;
              background-color: #74d2d4;
              margin: 0 10px 10px 10px;
              overflow: hidden;
              .time-out {
                position: absolute;
                top: -10px;
                left: -10px;
                width: 53px;
                height: 51px;
                background: url("../images/ico-time-out.png") no-repeat;
              }

              .coupon-price {
                width: 79px;
                height: 100px;
                line-height: 100px;
                font-size: 18px;
                color: #fff;
                text-align: center;
                border-right: 1px dashed #fff;
                span {
                  font-size: 40px;
                  font-weight: bold;
                }
              }
              .coupon-text {
                padding-top: 15px;
                padding-left: 8px;
                .msg-p1 {
                  font-size: 16px;
                  color: #fff;
                }
                .msg-p2 {
                  margin-top: 18px;
                  font-size: 14px;
                  color: #248f91;
                }
                .coupon-time {
                  margin-top: 8px;
                  font-size: 12px;
                  color: #248f91;
                }

              }
            }
          }
        }
      }
      .msg-txt {
        height: 60px;
        line-height: 60px;
        text-align: center;
        color: #666;
        font-size: 18px;
      }

    }
    .check-coupon {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 56px;
      background-color: #f2f2f2;
      .check-btn {
        position: relative;
        top: 10px;
        left: 60px;
        display: block;
        width: 160px;
        height: 36px;
        line-height: 36px;
        text-align: center;
        color: #fff;
        font-size: 18px;
        background-color: #ff6767;
      }
    }
  }
}























